package com.seabook.store.goodmgr.web;

import org.springframework.util.StringUtils;
import org.springframework.validation.Errors;

import com.seabook.store.goodmgr.domain.Product;

public class ProductValidator {
    public void validate(Product product, Errors errors) {
        String name = product.getName();
        if (!StringUtils.hasLength(name)) {
            errors.rejectValue("name", "required", "required");
        }
    }
}
